package commands.controller;

/**
 * Request to search network for file
 * @author Marcin Kamionowski
 */
public class CC_GUISearch extends ControllerCommand {

    private final String name;
    private final int minSize;
    private final int maxSize;
    private final int idSearch;

    /**
     * Constructor
     * @param name String putted by user
     * @param minSize Minimum size of file
     * @param maxSize Maximum size of file
     * @param id Searching identyfikator
     */
    public CC_GUISearch(int id, String name, int minSize, int maxSize) {
        super(ControllerCommandType.GUI_SEARCH);
        this.name = name;
        this.minSize = minSize;
        this.maxSize = maxSize;
        this.idSearch = id;
    }

    /**
     * Getter
     * @return Maximum size of file
     */
    public int getMaxSize() {
        return maxSize;
    }

    /**
     * Getter
     * @return Minimum size of file
     */
    public int getMinSize() {
        return minSize;
    }

    /**
     * Getter
     * @return String putted by user
     */
    public String getName() {
        return name;
    }

    /**
     * Getter
     * @return Searching identyfikator
     */
    public int getIdSearch() {
        return idSearch;
    }

    @Override
    public String toString() {
        StringBuilder toStringBuilder = new StringBuilder();
        toStringBuilder.append(super.toString());
        toStringBuilder.append("\n");
        toStringBuilder.append("\nname: ");
        toStringBuilder.append(name);
        toStringBuilder.append("\nminSize: ");
        toStringBuilder.append(minSize);
        toStringBuilder.append("\nmaxSize: ");
        toStringBuilder.append(maxSize);
        return toStringBuilder.toString();
    }
}
